@echo off

echo target_dir (default = ..\Depend\xgcBase)
set /P target_dir=

if "%target_dir%"=="" set target_dir=..\Depend\xgcBase

echo binary_dir (default = ..\Bin)
set /P binary_dir=

if "%binary_dir%"=="" set binary_dir=..\Bin

echo %target_dir%
echo %binary_dir%

:choice
cls

echo 1. debug
echo 2. debug_ansi
echo 3. release
echo 4. release_ansi
echo 0. exit

set /P choice=

if %choice%==1 goto debug
if %choice%==2 goto debug_ansi
if %choice%==3 goto release
if %choice%==4 goto release_ansi

if %choice%==0 goto end
goto choice

:debug
set version=debug
goto work

:debug_ansi
set version=debug
goto work

:release
set version=release
goto work

:release_ansi
set version=release_ansi
goto work

:work

if not exist %target_dir% md %target_dir%

if not exist %target_dir%\include md %target_dir%\include
if not exist %target_dir%\lib\ md %target_dir%\lib
if not exist %target_dir%\lib\%version% md %target_dir%\lib\%version%

copy common\*.h %target_dir%\include /y
xcopy common\*.hpp %target_dir%\include /y /s
copy database\database.h %target_dir%\include /y
copy netbase\netbase.h %target_dir%\include /y

copy bin\%version%\*.dll %binary_dir%\%version% /y

copy lib\%version%\*.lib %target_dir%\lib\%version% /y

pause
set %choice%=
echo %choice%
goto choice

:end
echo publish xgcBase finished...